Title:		Esper Restrictions
Author:		Synchysi
Version:	2.3
Applies to:	FF3us v1.0 and v1.1 (headered)
Tested on:	FF3us v1.0

Contents:	restrict_espers.asm
			restrict_espers_readme.txt

ROM addresses: C3/F091 to C3/F136 (166 bytes)

--------------------------------------------------------------------------------

Description:

The only reason an esper would be grey (i.e., unequippable) is if someone else
was already using it. This patch allows for restricting espers by character
to add individuality (or remove customization, depending on your point of view)
beyond unique battle commands. It's best used alongside a fairly thorough
overhauling of the spell list and level bonuses for each esper.

There is no limit to how many characters can use any particular esper. That is,
you can allow Ramuh to be equipped by everyone if you wish, while at the same
time allow only Terra to equip Maduin.

If an esper a character can use is already equipped by someone else, it will
show up as grey text with a blue shadow (as opposed to a black shadow if the
esper is just unusable).

--------------------------------------------------------------------------------

How to use this patch:

To allow for proper end-user customization, no patch is supplied. Instead, an
assembly file is included that will need to be altered and applied to an FF3us
ROM. In order to apply the assembly file to a ROM, head to Google and find
SNEStuff or version 0.06 of xkas.

Open restrict_espers.asm in your favorite text editor (Notepad works) and head
to the bottom of the page. There you will see 64 bytes of data (four for each
character slot) that are arranged like this:

DB $00,$00,$00,$00	; Terra

This particular data set applies to Terra, and all espers are set as
unequippable. In order to set an esper equippable, check the commentary below
this data block to see which bit/byte combination applies to which esper and
set them as desired. For example:

To enable Maduin, Terrato, and Ifrit on Terra, first you'd check the comments
below the data block and see that all three espers reside in byte 1 - Maduin is
bit 6, Terrato is bit 4, and Ifrit is bit 1. Take this byte (01010010) and
convert it to hex ($82), and there's Terra's first esper byte. Do this for each
character/byte combination and apply to your ROM, and you're good to go.

All espers are disabled by default.

It's inadvisable to change anything else unless you know what you're doing.

--------------------------------------------------------------------------------

Version history:

v1.0 - April 3, 2012
		Hack completed.

v1.1 - August 26, 2012
		Added in coloration for espers that someone could equip, but were already
		in use by someone else. These espers will now show black text with blue
		shadowing.

v2.0 - November 20, 2015
		Re-wrote the hack so it uses signficiantly fewer bytes at the end of
		bank C3 (older versions used as many as 1034 bytes, as opposed to the
		166 bytes this version uses), thanks to tips from KingMike at RHDN.

v2.1 - October 30, 2017
		Corrected an issue that resulted in running a loop over 17,000 times,
		causing some input lag and changing the color of the esper name on the
		esper details screen.

v2.2 - November 5, 2017
		Corrected an issue preventing some espers from being properly restricted
		or allowed.

v2.3 - February 23, 2019
		Documentation update only - created an easy-to-read table of the
		equippable esper struct at the bottom of the .asm file.

--------------------------------------------------------------------------------

Credits:

The authors of the disassembly for bank C3:
	Imzogelmo, Lenophis, assassin, Dragonsbrethren, Novalia Spirit

Geiger, for the SNES9x debugger.

KingMike of RHDN, for suggesting a much more efficient way to write this hack.

I also stole this readme format from Lenophis' stat growth hack.